package com.example.springMVC.controller;

import com.example.springMVC.commons.Result;
import com.example.springMVC.pojo.Role;
import com.example.springMVC.service.RoleService;
import com.example.springMVC.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/role")
public class RoleController {
    @Autowired
    RoleService roleService;
    @ResponseBody
    @RequestMapping("/getRoleNameList")
    public Result getRoleNameList(){
         List<Role> roleList=roleService.getRoleNameList();
         return Result.success(roleList);
    }
}
